- 
                Notifications
    You must be signed in to change notification settings 
- Fork 841
HybridCache stability and logging improvements #5467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Hey @mgravell, as FYI I have re-targeted this PR to  | 
- enforce payload quota - enforce key validity - add proper logging (infrastructure failure: needs attn) # Conflicts: # src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj
- log deserialization failures - expose serialization failures - tests for serialization logging scenarios
bab8ba8    to
    5605ce5      
    Compare
  
            
          
                ...ibraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.MutableCacheItem.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...ibraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.MutableCacheItem.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.CacheItem.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.Serialization.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.Serialization.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.StampedeStateT.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.StampedeStateT.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.StampedeStateT.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/HybridCacheEventSource.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.StampedeStateT.cs
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/HybridCacheEventSource.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/Log.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                test/Libraries/Microsoft.Extensions.Caching.Hybrid.Tests/LogCollector.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                test/Libraries/Microsoft.Extensions.Caching.Hybrid.Tests/HybridCacheEventSourceTests.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/HybridCacheEventSource.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | } | ||
| } | ||
| } | ||
| catch (Exception ex) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to catch the (OperationCanceledException ex) when (SharedToken.IsCancellationRequested) ? (or ex.CancellationToken == SharedToken)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You resolved the conversation without making a change or comment. Would like to know the resolution here.
        
          
                src/Libraries/Microsoft.Extensions.Caching.Hybrid/Internal/DefaultHybridCache.cs
          
            Show resolved
            Hide resolved
        
              
          
                test/Libraries/Microsoft.Extensions.Caching.Hybrid.Tests/TestEventListener.cs
          
            Show resolved
            Hide resolved
        
              
          
                ...crosoft.Extensions.Telemetry.Abstractions/Microsoft.Extensions.Telemetry.Abstractions.csproj
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | Pretty sure the CI failure is timing; will tweak tomorrow | 
* - handle serialization failures - enforce payload quota - enforce key validity - add proper logging (infrastructure failure: needs attn) # Conflicts: # src/Libraries/Microsoft.Extensions.Caching.Hybrid/Microsoft.Extensions.Caching.Hybrid.csproj * - add "callback" to .dic - log deserialization failures - expose serialization failures - tests for serialization logging scenarios * support and tests for stability despite unreliable L2 * nit * Compile for NS2.0 * include enabled check in our log output * add event-source tracing and counters * explicitly specify event-source guid * satisfy the stylebot overloads * nix SDT * fix failing CI test * limit to net462 * PR feedback (all except event tests) * naming * add event source tests * fix redundant comment * add clarification * more clarifications * dance for our robot overlords * drop Microsoft.Extensions.Telemetry.Abstractions package-ref * fix glitchy L2 test * better tracking for invalid event-source state * reserve non-printable characters from keys, to prevent L2 abuse * improve test output for ETW * tyop * ETW tests: allow longer if needed * whitespace * more ETW fixins --------- Co-authored-by: Jose Perez Rodriguez <[email protected]>
Stability (i.e. when bad things happen, it should be as gentle as possible) and logging:
ILoggerlogging of significant eventsEventSourcecaptureMaximumPayloadBytes, fixes HybridCache MaximumPayloadBytes not operating per documentation #5432MaximumKeyLength(do not use cache for invalid keys)Microsoft Reviewers: Open in CodeFlow